/* Copyright 2016 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

:host > ::content > * {
  margin: 0;
  padding: 0;
}

dialog {
  background-color: transparent;
  border: none;
  font-size: 100%;
  height: 100%;
  margin: 0;
  max-height: initial;
  max-width: initial;
  opacity: 0;
  outline: none;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

dialog[open] {
  opacity: 1;
  transition: opacity 200ms;
}

dialog:focus {
  outline: none;
}

dialog#delete-confirm-dialog::backdrop {
  background-color: transparent;
}

.thumbnail {
  flex: none;
  height: 100%;
  width: 100%;
}

#video-poster {
  max-height: 100%;
  max-width: 100%;
}

#audio-artwork {
  height: 100%;
  margin: 0 auto;
  width: 100%;
}

#mainPanel {
  background-color: transparent;
  bottom: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  /* The top value here should be the total height of the #toolbar including
  the height and the border-width */
  top: 57px;
  width: 100%;
}

#contentPanel {
  background-color: transparent;
  display: flex;
  height: 100%;
  justify-content: center;
  position: relative;
}

#contentPanel[metadata-box-active] {
  margin-inline-end: 320px;
}

:host-context(html[dir='rtl']) #contentPanel[metadata-box-active] {
  margin-inline-end: 320px;
  margin-inline-start: auto;
}

#innerContentPanel {
  background-color: var(--cros-app-shield-80);
  color: var(--cros-text-color-primary);
  display: flex;
  flex-direction: column;
  height: calc(100% - 64px);
  justify-content: center;
  outline: none;
  padding: 32px;
  position: relative;
  text-align: center;
  width: 100%;
}

#innerContentPanel[type='audio'],
#innerContentPanel[type='image'],
#innerContentPanel[type='video'] {
  align-self: center;
}

.content {
  height: 100%;
  width: 100%;
}

.text-content {
  background-color: var(--cros-bg-color);
}

#toolbar {
  align-items: center;
  background-color: var(--cros-bg-color);
  border-bottom: 1px solid var(--cros-separator-color);
  color: var(--cros-text-color-primary);
  display: flex;
  font-family: 'Roboto Medium';
  font-size: 14px;
  height: 56px;
  margin: 0;
  opacity: 1;
  padding: 0;
  z-index: 1;
}

#file-path {
  flex: 1;
  margin-inline-start: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buttons-group {
  display: flex;
}

cr-button {
  --hover-bg-color:var(--cros-ripple-color);
  --ink-color: var(--cros-ripple-color);
  --ripple-opacity: 100%;
  --text-color: var(--cros-icon-color-primary);
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: none;
  box-sizing: border-box;
  height: 36px;
  margin: 0 6px;
  min-width: 36px;
  padding: calc(6px - 2px);
  width: 36px;
}

:host-context(html.pointer-active) cr-button:not(:active):hover {
  --hover-bg-color: none;
  cursor: unset;
}

cr-button::after {
  content: '';
  height: 48px;
  position: absolute;
  width: 48px;
}

#back-button > .icon,
#open-button > .icon,
#delete-button > .icon,
#info-button > .icon {
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  background-color: currentColor;
  background-image: none;
  height: 36px;
  width: 36px;
}

iron-icon {
  height: 16px;
  width: 16px;
}

#back-button > iron-icon {
  display: none;
}

#back-button > .icon {
  -webkit-mask-image: url(../images/files/ui/back.svg);
}

#open-button > .icon {
  -webkit-mask-image: url(../images/files/ui/external_link.svg);
}

#delete-button > .icon {
  -webkit-mask-image: url(../images/files/ui/delete_ng.svg);
  height: 16px;
  width: 16px;
}

#info-button[aria-pressed=true] {
  background-color: var(--cros-ripple-color);
}

#info-button > .icon {
  -webkit-mask-image: url(../images/files/ui/info.svg);
}

:host-context(html.focus-outline-visible) cr-button:not(:active):focus {
  border: 2px solid var(--cros-focus-ring-color);
}

#metadata-box {
  background-color: var(--cros-bg-color-dropped-elevation-1);
  bottom: 0;
  height: 100%;
  margin: 0;
  opacity: 1;
  overflow-y: auto;
  position: absolute;
  right: 0;
}

:host-context(html[dir='rtl']) #metadata-box {
  left: 0;
  right: auto;
}

::-webkit-scrollbar {
  background-color: var(--cros-app-scrollbar-color);
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background-clip: content-box;
  background-color: var(--cros-app-scrollbar-color-hover);
  border: 2.5px solid transparent;
  width: 5px;
}

[hidden] {
  display: none;
}

.no-preview {
  margin-top: 16px;
}

@media only screen and (max-width: 720px) {
  #contentPanel[metadata-box-active] #innerContentPanel {
    padding-inline-end: 4px;
    padding-inline-start: 4px;
  }
  #contentPanel[metadata-box-active] {
    margin-inline-end: 250px;
  }
}

/* Large generic thumbnails, used when a file does not have a thumbnail. */
[generic-thumbnail] {
  -webkit-mask-image: url(../images/filetype/filetype_generic.svg);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: auto 88px;
  background-color: currentColor;
  background-position: center;
  background-repeat: no-repeat;
  background-size: auto 88px;
  height: 88px;
}

[generic-thumbnail='.folder'] {
  -webkit-mask-image: url(../images/filetype/filetype_folder.svg);
  -webkit-mask-size: auto 72px;
}

[generic-thumbnail='audio'] {
  -webkit-mask-image: none;
  background-color: transparent;
  background-image: url(../images/filetype/filetype_audio.svg);
}

[generic-thumbnail='image'] {
  -webkit-mask-image: none;
  background-color: transparent;
  background-image: url(../images/filetype/filetype_image.svg);
}

[generic-thumbnail='video'] {
  -webkit-mask-image: none;
  background-color: transparent;
  background-image: url(../images/filetype/filetype_video.svg);
  background-size: auto 72px;
}
